from selenium import webdriver
import os
from postion import options
from postion import service
def inster_img(driver,name):
    dir_name=os.path.dirname(__file__)
    print(dir_name)
    img_name=rf'{dir_name}\reports\screenshots\{name}.png'
    print(img_name)
    driver.get_screenshot_as_file(img_name)

if __name__ == '__main__':
    name='baidu'
    url=r'https://www.baidu.com/'
    driver=webdriver.Chrome(options=options,service=service)
    driver.get(url)
    inster_img(driver,name)
    driver.quit()